/*************************************************************************
> File Name: 005.c
> Author: icebear
> Mail: 3322366195@qq.com
> Created Time: 2023-07-19 13:51:44
> Description: 输入三个整数x,y,z，请把这三个数由小到大输出
************************************************************************/
#include <stdio.h>
int main(int argc, char const *argv[])
{
    int temp, min, min_sub;
    int arr[3] = {0};
    while (1)
    {
        printf("input three integer\n");
        scanf("%d%d%d", &arr[0], &arr[1], &arr[2]);
        for (int i = 0; i < 3; i++)
        {
            min = arr[i];
            min_sub = i;
            for (int j = i + 1; j < 3; j++)
            {
                if (arr[j] < min)
                {
                    min = arr[j];
                    min_sub = j;
                }
            }
            if (min_sub != i)
            {
                temp = arr[i];
                arr[i] = arr[min_sub];
                arr[min_sub] = temp;
            }
        }
        printf("the sort array is \"");
        for (int i = 0; i < 3; i++)
        {
            printf("%d,", arr[i]);
        }
        printf("\b\"\n");
    }
    return 0;
}
